package com.lzb.play.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.lzb.play.R;
import com.lzb.play.basic.ProviderMultiAdapter;
import com.lzb.play.bean.GridBean;
import com.lzb.play.bean.HomeBirdBean;

public class SetGridAdapter extends ProviderMultiAdapter<GridBean> {

    public SetGridAdapter() {
        addItemProvider(new SetGridProvider());
    }

    private class SetGridProvider extends BaseItemProvider<GridBean> {
        @Override
        public int getItemViewType() {
            return ProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_set_grid;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, GridBean bean) {
            if (bean.isSetting()) {
                baseViewHolder.setImageResource(R.id.ivSetGridItemBg, R.drawable.set_grid_sel);
                baseViewHolder.setImageResource(R.id.ivSetGridItemImg, R.drawable.after);
            } else {
                baseViewHolder.setImageResource(R.id.ivSetGridItemBg, R.drawable.set_grid_bg);
                baseViewHolder.setImageResource(R.id.ivSetGridItemImg, R.drawable.before);
            }
        }
    }

}
